package com.jy.admin.db.dao.impl;

import com.fqgj.common.api.Page;
import com.fqgj.common.base.AbstractBaseMapper;
import com.jy.admin.db.dao.ClCommentDao;
import com.jy.admin.db.entity.ClCommentEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * User: anonymous
 * Date: 2022-01-07
 * Time: 12:40:39.034
 */

@Repository
public class ClCommentDaoImpl extends AbstractBaseMapper<ClCommentEntity> implements ClCommentDao {

    @Override
    public List<ClCommentEntity> selectListBySyncStatusAndPage(Integer syncStatus, Page page) {
        Map<String, Object> params = new HashMap<>();
        params.put("syncStatus", syncStatus);
        params.put("page", page);
        return getSqlSession().selectList(this.getStatement("selectListBySyncStatusAndPage"), params);
    }

    @Override
    public void updateSyncStatusById(Integer id, Integer syncStatus) {
        Map<String, Object> params = new HashMap<>();
        params.put("id", Long.parseLong(id + ""));
        params.put("syncStatus", syncStatus);
        getSqlSession().update(this.getStatement("updateSyncStatusById"), params);
    }
}